1. Field of the Invention
The present invention relates to an information processing apparatus, a generation method, and a storage medium, and particularly to a technique for rendering a three-dimensional scene.
2. Description of the Related Art
3DCG (Three-Dimensional Computer Graphics) is used as a visualization representation method used not only in games and movies, but also in various fields. In the technical field of image generation according to 3DCG, various techniques are proposed in recent years so as to achieve more photorealistic rendering or to render to a high quality rendering representation.
One of the rendering representations in 3DCG is to render a shadow that is created when light hits an arranged object. A typical example of the method for rendering a shadow created by an object is shadow mapping method. With the shadow mapping method, first, with respect to a perspective from a light source that casts a shadow, a depth map (shadow map) for a render target field is generated. Then, whether or not the shadow is to be created in each pixel of an image that is to be generated is determined based on whether or not the distance between the object in the pixel and the light source exceeds a pixel value (depth value) in the shadow map recorded for the corresponding light path, and whether or not performing the rendering of the shadow is controlled. That is, with the shadow mapping method, each pixel in the shadow map indicates the distance to a plane (fragment) that a ray emitted from the corresponding position of the light source or in the corresponding direction firstly hits, and thus it is easily determined that the shadow is to be rendered for the fragments located at positions beyond the distance in the light path of the ray.
The quality of a shadow rendered by using the shadow mapping method depends on the resolution of the shadow map generated. A case will be considered as an example in which there are two objects that are covered by the same number of pixels in a shadow map. In this case, a shadow caused by one of the objects, which is arranged at a position far from a rendering viewpoint, on a plane located far from the viewpoint occupies a small number of pixels in an image to be generated, and thus the quality of the shadow would not be a problem. On the other hand, a shadow caused by the other object, which is arranged at a position located close to the rendering viewpoint, on a plane located at a short distance from the viewpoint occupies a large number of pixels in the image to be generated. At this time, if the number of pixels of the target object in the shadow map is less than the number of pixels used to render the shadow in the image, the caused shadow is rendered in a plurality of pixels in the image based on one pixel in the shadow map. That is, aliasing occurs in the shadow, which may give impression to the observer that quality degradation in the shadow has occurred in the generated image.
In order to improve the quality of shadows, a method can be conceived to increase the resolution of shadow maps. This method, however, requires an increase in the amount of computation to generate a shadow map and an increase in the memory area used to store the shadow map, and thus the method is not practical. Accordingly, various proposals have been made to generate a shadow map with which a high quality shadow can be rendered while suppressing the increase in the amount of computation and in the amount of data required to generate the shadow map (“Adaptive Shadow Maps”, by Randima Fernando et al., SIGGRAPH 2001 Paper, pp. 387 to 390, and “Rectilinear Texture Warping for Fast Adaptive Shadow Mapping”, by Paul Rosen, Interactive 3D Graphics and Games 2012, pp. 151 to 158).
Rosen proposes a warping method that analyzes the importance of each region in a field in a perspective from a light source with respect to the rendering viewpoint, and increases or decreases the number of ray bundles assigned to the region in the shadow map according to the importance. According to Rosen, control is performed so as to assign a large number of pixels in the shadow map to a local region having high importance without changing the resolution of the shadow map generated. Thus, it is possible to reduce the occurrence of aliasing in a shadow caused on a plane close to the viewpoint while suppressing the increase in the amount of computation and in the amount of data.
According to the technique of Rosen, an importance map is generated that indicates the importance of each region in the field, the importance distribution is analyzed with respect to each of the horizontal direction and the vertical direction of the importance map so as to identify regions of high importance in the map. Therefore, the use of the technique of Rosen enables warping processing to be appropriately performed in the case where there locally are regions of high importance in the importance map, as shown in FIG. 6A.
On the other hand, in the case where regions of high importance are distributed to extend in a direction that is neither the horizontal direction nor the vertical direction as shown in FIG. 6B, warping processing cannot be appropriately performed even if the importance distribution is analyzed with respect to each of the horizontal direction and the vertical direction according to the technique of Rosen. That is, in the case where regions of high importance are distributed as shown in FIG. 6B, the importance distribution indicates a uniform distribution in the horizontal direction and the vertical direction. Accordingly, according to the technique of Rosen, it is determined that the regions of high importance are distributed throughout the entire map, and as a result, the area assigned to the regions of high importance is not increased in the shadow map, and thus it may not be possible to improve the quality of the shadow.